package com.siwei.mes.entity.order;

import com.siwei.mes.common.validator.AddGroup;
import com.siwei.mes.common.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * 工单打卡(OrderClock)实体类
 *
 * @author makejava
 * @since 2023-12-05 09:31:32
 */
@Data
@Table(name = "pk_order_clock")
@Accessors(chain = true)
@ApiModel(value = "OrderClock", description = "工单打卡")
public class OrderClock implements Serializable {
    private static final long serialVersionUID = 151043833766291577L;
    /**
     * 主键id
     */
    @Id
    @ApiModelProperty(value = "工单打卡主键ID", name = "id")
    private Long id;
    /**
     * 工单id
     */
    @Column(name = "order_id")
    @ApiModelProperty(value = "工单id", name = "orderId")
    @NotNull(groups = {AddGroup.class, UpdateGroup.class}, message = "工单id为空")
    private Long orderId;
    /**
     * 打卡人
     */
    @Column(name = "user_id")
    @ApiModelProperty(value = "打卡人", name = "userId")
    private Long userId;
    /**
     * 打卡人名称
     */
    @Column(name = "user_name")
    @ApiModelProperty(value = "打卡人名称", name = "userName")
    private String userName;
    /**
     * 打卡经度
     */
    @Column(name = "clock_lng")
    @ApiModelProperty(value = "打卡经度", name = "clockLng")
    @NotNull(groups = {AddGroup.class, UpdateGroup.class}, message = "打卡经度为空")
    private Double clockLng;
    /**
     * 打卡纬度
     */
    @Column(name = "clock_lat")
    @ApiModelProperty(value = "打卡纬度", name = "clockLat")
    @NotNull(groups = {AddGroup.class, UpdateGroup.class}, message = "打卡纬度为空")
    private Double clockLat;
    /**
     * 打卡地址
     */
    @Column(name = "clock_address")
    @ApiModelProperty(value = "打卡地址", name = "clockAddress")
    @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "打卡地址为空")
    private String clockAddress;
    /**
     * 打卡说明
     */
    @Column(name = "memo")
    @ApiModelProperty(value = "打卡说明", name = "memo")
    private String memo;
    /**
     * 打卡时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "打卡时间", name = "createTime")
    private Date createTime;
}
